Skip to content

Conversation

icodebyamanda
Copy link

@icodebyamanda icodebyamanda commented Oct 17, 2025

Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/72649045549333/task/1211479926220519?focus=true

Description

  • Add JSDoc type definitions matching element-hiding.ts schema
  • Cast getFeatureSetting return values to proper types with fallbacks
  • Update function parameter types to use new JSDoc types
  • Add type guards for union types (ElementHidingRule)
  • Preserve all original comments from codebase
  • Fix TypeScript compilation errors with proper null checks

This integrates the refactored schema types from privacy-configuration into the content-scope-scripts element-hiding feature for better type safety and maintainability.

Testing Steps

Checklist

Please tick all that apply:

  • [x ] I have tested this change locally
  • [x ] I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

Note

Adds JSDoc schema types, type guards, and null-safe defaults to injected/src/features/element-hiding.js, tightening rule/value handling and style tag injection.

  • Types and Safety:
    • Add JSDoc typedefs for ElementHidingValue, ElementHidingRule, domain/config types; annotate functions with these types.
    • Add guards for union types (e.g., 'selector' in rule) before querying DOM or building selectors.
    • Check rule.values before modify-attr/modify-style and type params for modifyAttribute/modifyStyle.
    • Cast getFeatureSetting returns with explicit types and safe defaults for rules, adLabelStrings, useStrictHideStyleTag, hideTimeouts, unhideTimeouts, mediaAndFormSelectors.
  • Logic Hardening:
    • Update injectStyleTag and hideAdNodes to handle rules without selector.
    • Minor doc/comment and param type updates across helpers (e.g., extractTimeoutRules, applyRules, expandNonEmptyDomNode).

Written by Cursor Bugbot for commit 9f7d33f. This will update automatically on new commits. Configure here.

- Add JSDoc type definitions matching element-hiding.ts schema
- Cast getFeatureSetting return values to proper types with fallbacks
- Update function parameter types to use new JSDoc types
- Add type guards for union types (ElementHidingRule)
- Preserve all original comments from codebase
- Fix TypeScript compilation errors with proper null checks

This integrates the refactored schema types from privacy-configuration
into the content-scope-scripts element-hiding feature for better
type safety and maintainability.
@icodebyamanda icodebyamanda requested a review from a team as a code owner October 17, 2025 14:02
Copy link

netlify bot commented Oct 17, 2025

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit 9f7d33f
🔍 Latest deploy log https://app.netlify.com/projects/content-scope-scripts/deploys/68f24c6d693c640008f69173
😎 Deploy Preview https://deploy-preview-2016--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

[Beta] Generated file diff

Time updated: Fri, 17 Oct 2025 14:03:13 GMT

Android
    - android/contentScope.js

File has changed

Apple
    - apple/contentScope.js

File has changed

Chrome-mv3
    - chrome-mv3/inject.js

File has changed

Firefox
    - firefox/inject.js

File has changed

Integration
    - integration/contentScope.js

File has changed

Windows
    - windows/contentScope.js

File has changed

Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants